<?php


namespace App\Constant;

class ApiV2Constant
{
    public const ERROR_CODE = 1;
    public const ERROR_NO_AUTH_CODE = 401;

    public const MODEL_COURSE_FIELD = [
        'id', 'user_id', 'title', 'slug', 'thumb', 'charge', 'short_description', 'description', 'seo_keywords',
        'seo_description', 'is_recommend', 'is_show', 'user_count', 'category_id', 'is_free', 'group',
        'combos', 'media_images', 'media_video', 'papers', 'user', 'files','chat_id','members','faqs','account',
        // 额外字段
        'videos_count', 'category'
    ];

    public const GROUP_FILTER_FIELD = [
        'cid','page','size','user_id','company_id','not_study','is_free','sort','charge'
    ];
    public const ANTHOLOGY_FILTER_FIELD = [
        'cid','page','size','user_id','company_id','not_study','is_free','sort','charge'
    ];
    public const COURSE_FILTER_FIELD = [
        'cid','page','size','user_id','company_id','not_study','is_free','sort','charge'
    ];
    public const COMBO_FILTER_FIELD = [
        'cid','page','size','user_id','company_id','not_study','is_free','sort','charge'
    ];

    public const MODEL_RECORD_FIELD = [
        'id', 'user_id', 'title','thumb', 'charge', 'url','short_description', 'description','category_id','duration',
    ];
    public const MODEL_ACTIVITY_FIELD = [
        'WeightFragment' => ['title','id', 'user_id', 'created_at','thumbsup_count'],
        'WishFragment' => ['title','id', 'user_id', 'created_at','thumbsup_count'],
        'Conquer' => ['id', 'title','thumb','start_at','weight','user_id', 'created_at','thumbsup_count'],
        'Run' => ['id', 'title','step','created_at','user_id','comments_count','thumbsup_count'],


    ];
    public const MODEL_ACTIVITY_WITH_FIELD = [
        'WeightFragment' => ['user:id,nick_name,avatar','images','videos'],
        'WishFragment' => ['user:id,nick_name,avatar','images','videos'],
        'Conquer' => ['user:id,nick_name,avatar'],
        'Run' => ['user:id,nick_name,avatar','images','videos'],
    ];
    public const MODEL_RECOMMEND_WITH_FIELD = [
        'WeightFragment' => ['user:id,nick_name,avatar'],

    ];
    public const MODEL_RECOMMEND_FIELD = [
        'course' => ['id', 'user_id', 'title', 'thumb','created_at','thumbsup_count','view_count'],
        'issue' => ['id', 'user_id','video_id','created_at','thumbsup_count','view_count'],
        'note'=>['id','user_id','title','course_id','video_id','created_at','thumbsup_count','favorite_count','view_count'],
        'article' => ['id', 'user_id','title','thumb','created_at','thumbsup_count','favorite_count','view_count'],
        'video' => ['id', 'user_id','title','thumb','created_at','thumbsup_count','favorite_count','view_count'],
        'doubt' => ['id', 'to_id', 'author_id','created_at','title','thumbsup_count','view_count'],
        'anthology' => ['id', 'user_id','created_at','title','thumb','thumbsup_count','view_count'],
        'solution' => ['id', 'user_id','content','thumbsup_count','created_at','view_count'],
        'videoRecord' => ['id', 'user_id','title','thumb','thumbsup_count','created_at','view_count'],
        'problem' => ['id', 'user_id','title','created_at','view_count'],

    ];


    public const TAG_RESOURCE_WITH_FIELD = [
        'video' => ['user'],
        'issue' => ['user'],
        'article' => ['user'],
        'doubt' => ['student','user'],
         'question' => ['user']
    ];

    public const MODEL_COMBO_FIELD = [
        'id', 'user_id', 'title', 'slug', 'thumb', 'charge', 'short_description', 'description','chat_id'

    ];

    public const MODEL_ARTICLE_FIELD = [
        'id', 'user_id', 'title', 'thumb', 'charge', 'short_description', 'description',

    ];
    public const MODEL_ANTHOLOGY_FIELD = [
        'id', 'user_id', 'title', 'thumb', 'charge', 'short_description', 'description',

    ];
    public const MODEL_GROUP_FIELD = [
        'id', 'name', 'thumb'

    ];

    public const MODEL_PAPER_FIELD = [
        'id', 'title', 'title'

    ];
    public const MODEL_QUESTION_FIELD = [
        'id', 'title', 'title'

    ];
    public const MODEL_VIDEO_FIELD = [
        'id', 'title', 'slug', 'view_count', 'seo_keywords', 'seo_description', 'short_description', 'description',
        'charge', 'chapter_id', 'duration', 'free_seconds', 'course_id', 'aliyun_video_id', 'thumb'

    ];

    public const MODEL_MEMBER_FIELD = [
        'id', 'avatar', 'nick_name', 'mobile', 'account','is_lock', 'is_active', 'role_id', 'expired_at', 'brief_introduce',
        'invite_balance', 'is_password_set', 'is_set_nickname', 'is_used_promo_code',
        'created_at', 'credit1', 'credit2', 'credit3', 'roles', 'profile','uuid','author','thumbsup_count','is_company_administrator','is_set_avatar','is_set_nickname','is_team_leader'
    ];

    public const MODEL_ROLE_FIELD = [
        'id', 'title', 'charge', 'expire_days', 'desc_rows', 'privileges','thumb','shop'
    ];

    public const MODEL_COURSE_CHAPTER_FIELD = [
        'id', 'course_id', 'title',
    ];

    public const MODEL_COURSE_CATEGORY_FIELD = [
        'id', 'name', 'parent_id', 'children',
    ];

    public const MODEL_COURSE_COMMENT_FIELD = [
        'id', 'user_id', 'content', 'created_at',
    ];

    public const MODEL_VIDEO_COMMENT_FIELD = [
        'id', 'user_id', 'render_content', 'created_at',
    ];

    public const MODEL_ARTICLE_COMMENT_FIELD = [
        'id', 'user_id', 'render_content', 'created_at', 'user'
    ];

    public const MODEL_ORDER_FIELD = [
        'id', 'user_id', 'charge', 'order_id', 'payment_method', 'status_text', 'payment_text', 'continue_pay',
        'goods', 'created_at',
    ];

    public const MODEL_ORDER_GOODS_FIELD = [
        'num', 'goods_text', 'charge', 'goods_type', 'goods_name', 'goods_thumb', 'goods_id', 'goods_charge','goods_expired_id',
        'goods_ori_charge',
    ];

    public const MODEL_PROMO_CODE_FIELD = [
        'id', 'code', 'expired_at', 'invited_user_reward', 'invite_user_reward',
    ];

    public const MODEL_SLIDER_FIELD = [
        'thumb', 'url', 'sort', 'platform',
    ];

    public const MODEL_NOTIFICATON_FIELD = [
        'id', 'notifiable_id', 'data', 'read_at', 'created_at',
    ];

    public const MODEL_CREDIT1_RECORD_FIELD = [
        'sum', 'remark', 'created_at',
    ];

    public const MODEL_COURSE_ATTACH_FIELD = [
        'id', 'name', 'path', 'disk', 'size', 'extension', 'course'
    ];

    public const MODEL_MEMBER_PROFILE_FIELD = [
        'real_name', 'gender', 'age', 'birthday', 'profession_tag', 'address', 'bg_image',
        'graduated_school', 'diploma',
        'id_number', 'id_frontend_thumb', 'id_backend_thumb', 'id_hand_thumb', 'is_fulltime', 'work_years', 'category_id'
    ];
}
